<!--
 * @Description: 
 * @Author: charles
 * @Date: 2020-11-03 12:36:26
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-07-06 17:44:09
-->
<template>
  <div>
    <div class="header">
      <div>
        <a href="/#/home">建党百年</a>
      </div>
      <div>
        <img src="../assets/yxtx/phone.png" alt="图片加载失败" />
        联系我们
      </div>
    </div>
    <div class="content">
      <!-- 卡片图 -->
      <div class="kapian">
        <el-carousel :interval="4000" type="card" height="400px">
          <el-carousel-item>
            <img src="../assets/yxtx/images/picture1.jpg" alt="图片丢失" />
          </el-carousel-item>
          <el-carousel-item>
            <img src="../assets/yxtx/images/picture2.jpg" alt="图片丢失" />
          </el-carousel-item>
          <el-carousel-item>
            <img src="../assets/yxtx/images/picture3.jpg" alt="图片丢失" />
          </el-carousel-item>
        </el-carousel>
      </div>
      <div class="substance">
        <!-- 红色影视 -->
        <div class="yxcard">
          <div class="yxtitle">红色影视</div>
          <div
            class="projectCard"
            v-for="item in projects"
            :key="item.id"
            @click="clickyxcard(item.id)"
          >
            <div class="photo">
              <img :src="item.figure" alt="图片丢失" />
            </div>
            <div class="introduce">
              <div class="title">
                <strong>{{ item.name }}</strong>
              </div>
              <div class="content">
                {{ item.introduce }}
              </div>
            </div>
          </div>
        </div>
        <!-- 红色精神 -->
        <div class="xsfc">
          <div class="xsfc_title">红色精神</div>
          <div class="allarcicles">
            <div
              class="articleCard"
              v-for="item in article"
              :key="item.id"
              @click="clickxsfc(item.id)"
            >
              <img :src="item.cover" alt="图片丢失" />
              <div class="articletitle">{{ item.title }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="footer"><strong>&copy;2021课设- 713 AND LU</strong></div>
    <div></div>
  </div>
</template>
<script>
import request from "../utils/request";
import moment from "moment";
export default {
  data() {
    return {
      projects: [],
      article: [],
    };
  },
  methods: {
    findAllProject() {
      request.get("/index/project/pageQuery?page=1&pageSize=5").then((res) => {
        this.projects = res.data.list;
        console.log(this.projects);
      });
    },
    findAllArticle() {
      request.get("/index/article/pageQuery?page=1&pageSize=6").then((res) => {
        this.article = res.data.list;
      });
    },

    clickyxcard(id) {
      this.$router.push({ path: "/project", query: { id } });
    },
    clickxsfc(id) {
      this.$router.push({ path: "/article", query: { id } });
    },
  },
  created() {
    this.findAllProject();
    this.findAllArticle();
  },
};
</script>
<style scoped>
a {
  text-decoration: none;
  color: black;
}
.header {
  height: 100px;
  box-shadow: 0px 0px 5px 1px #333;
  display: flex;
}
.header div {
  height: 100px;
  width: 200pd;
  line-height: 100px;
  font-size: 100px;
  text-align: center;
}
.header div:first-child {
  font-size: 40px;
  flex: 1;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}
.header div:last-child {
  font-size: 24px;
  padding-right: 20px;
  text-align: right;
  flex: 4;
}
.header img {
  height: 25px;
  width: 25px;
}
.lunbo img {
  margin-top: 5px;
  height: 475px;
  width: 100%;
}
.substance {
  margin: 0px 90px 0px 90px;
}
/* 红色影视 */
.yxtitle {
  height: 50px;
  line-height: 50px;
  font-size: 25px;
  font-weight: 900;
}
.projectCard {
  margin: 5px;
  height: 200px;
  width: 100%;
  display: flex;
}
.projectCard img {
  height: 168px;
  width: 300px;
}
.title {
  font-size: 20px;
  height: 30px;
  line-height: 30px;
  margin-left: 30px;
}
.content {
  margin-left: 30px;
  line-height: 25px;
}
.time {
  height: 30px;
  line-height: 30px;
  font-size: 16px;
}
.xsfc_title {
  height: 50px;
  line-height: 50px;
  font-size: 25px;
  font-weight: 900;
}
.articleCard {
  height: 280px;
  width: 360px;
  margin: 5px 10px;
  display: inline-block;
  vertical-align: text-top;
}
.articleCard img {
  height: 200px;
  width: 360px;
  margin: 2px;
}
.articletitle {
  font-size: 18px;
  overflow: auto;
  text-align: center;
}
.footer {
  text-align: center;
  text-align: middle;
  overflow: auto;
  padding-top: 30px;
  padding-bottom: 30px;
  height: 20px;
  box-shadow: 0px 0px 5px 1px #333;
}
</style>